import java.sql.*;
import java.util.*;
import java.io.*;
class JdbcDemo23 {

	public static void main(String[] args) throws Exception {
		Class.forName("oracle.jdbc.driver.OracleDriver");
		Connection cn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
		PreparedStatement ps = cn.prepareStatement("insert into mem_reg values(?,?,?,?)");
	    Scanner scan = new Scanner(System.in);
	    System.out.println("enter the name");
	    String name = scan.next();
	    System.out.println("enter the user name");
	    String uname = scan.next();
	    System.out.println("enter the password");
	    String pass = scan.next();
	    
		String fname = scan.next();
		File f = new File(fname);
	    FileInputStream fis = new FileInputStream(f);
	    ps.setBinaryStream(4, fis, f.length());
	    int count = ps.executeUpdate();
	    System.out.println(count);
	    cn.close();
	    ps.close();
	    
		// TODO Auto-generated method stub

	}

}
